FROM node:10-alpine
WORKDIR /ng-app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
RUN $(npm bin)/ng build --prod

FROM nginx:1.15-alpine
COPY default.conf /etc/nginx/conf.d/
RUN rm -rf /usr/share/nginx/html/*
COPY --from=0 /ng-app/dist /usr/share/nginx/html
CMD ["nginx", "-g", "daemon off;"]
